﻿using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;

namespace Lanbt.Core.Web.ServiceExtent
{
    public class SwaggerTagDesc : IDocumentFilter
    {
        public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
        {
            var tags = new List<OpenApiTag>
            {
                new OpenApiTag {
                    Name = "SystemManagerAction",
                    Description = "<code>系统管理</code>",
                    ExternalDocs= new OpenApiExternalDocs
                    {
                        Description = ""
                    }
                },
                new OpenApiTag {
                    Name = "HomeAction",
                    Description = "<code>Home</code>",
                    ExternalDocs= new OpenApiExternalDocs
                    {
                        Description = ""
                    }
                },
                new OpenApiTag {
                    Name = "QuartzAction",
                    Description = "<code>定时任务</code>",
                    ExternalDocs= new OpenApiExternalDocs
                    {
                        Description = ""
                    }
                },
                new OpenApiTag {
                    Name = "SystemConfigAction",
                    Description = "<code>系统配置</code>",
                    ExternalDocs= new OpenApiExternalDocs
                    {
                        Description = ""
                    }
                },
            };

            swaggerDoc.Tags = tags;
        }
    }
}
